package alkaid.eis.schedule.task;

import java.util.SplittableRandom;
import java.util.concurrent.TimeUnit;

import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;

/**
 * 演示任务
 *  
 * @author Lucky Yang
 * @since 0.0.1
 */
@Slf4j
@Component
public class DemoTask {
    private final static SplittableRandom RANDOM = new SplittableRandom();
    
    public void taskWithParams(String params) throws InterruptedException {
        TimeUnit.MILLISECONDS.sleep(RANDOM.nextLong(1000L));
        log.info("执行有参示例任务：{}" , params);
    }

    public void taskNoParams() throws InterruptedException {
        TimeUnit.MILLISECONDS.sleep(RANDOM.nextLong(1000L));
        log.info("执行无参示例任务");
    }    
}
